Imports System.IO
Imports My

Partial Class VisioViewer
    Inherits System.Web.UI.Page

    Public ShapesNode As New Specialized.StringDictionary

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'If Page.IsPostBack Then
        '    Dim sPostBackCtl$ = Page.Request.Params("__EVENTTARGET")

        '    If sPostBackCtl = "Viewer1" Then
        '        ShapesNode = Session("ShapesNode")

        '        lblShapeFile.Text = ShapesNode(Page.Request.Params("__EVENTARGUMENT"))
        '        If File.Exists(lblShapeFile.Text) Then
        '            txtShapeFile.Text = File.ReadAllText(lblShapeFile.Text)
        '        End If
        '    End If
        'End If


        If Page.IsPostBack Then
            Dim sPostBackCtl$ = Page.Request.Params("__EVENTTARGET")

            If sPostBackCtl = "Viewer1" Then
                Dim sShapeId$ = Page.Request.Params("__EVENTARGUMENT")
                'Call a WebMethod on our main page to do something there!


            End If
        End If


    End Sub

    Public Function UserVSDFileName$()

        Dim saUserID$() = Request.LogonUserIdentity.Name.Split("\")
        Dim sUserID$ = ""
        If Not IsNothing(saUserID) AndAlso saUserID.Length Then
            sUserID = "." & saUserID(saUserID.Length - 1)
        End If
        Return IO.Path.ChangeExtension( _
         System.Configuration.ConfigurationManager.AppSettings("DefaultVSDFileName"), _
         sUserID & ".vsd")

    End Function
End Class
